<template>
	<view class="background">
		<calendar 
			v-show="calendarIsShow" 
			:theme-color="'#1889F1'"
			 @callback="getCalendarDate" />
	</view>
</template>

<script>
	import Calendar from '@/components/calendar/index';
	import api from '../../api';
	export default {
		components: {
			Calendar,
		},
		data() {
			return {
				calendarIsShow: true,
			}
		},
		
		onLoad() {
			
		},
		
		methods: {
			getCalendarDate({startStr}) {
				this.currentDate = startStr.dateStr;
				this.calendarIsShow = false;
				const pages = getCurrentPages(); //页面栈
				const prePage = pages[pages.length - 2]; //上一页
				prePage.$vm.currentDate = startStr.dateStr; //触发上一页监听器
				prePage.$vm.getTicketList(); //触发上一页监听器
				uni.navigateBack()
			},
		}
	}
</script>

<style>
	.background {
		height: 100%;
	}
</style>
